<template>
	<view>
		<view class="tu">
			<view class="header" @click="islogin">
				<view class="list">
					<view class="yuan">
					</view>
					<navigator class="zi">
						<view class="" v-if="user">
							<view data-v-223c8b56="" class="font-md mb-2">{{user.username}}</view>
							<uni-view data-v-223c8b56="" class="font-sm">暂无描述</uni-view>
						</view>
						<view class="" v-else >
							<view data-v-223c8b56="" class="font-md mb-2">立即登录</view>
							<uni-view data-v-223c8b56="" class="font-sm">登录解锁更多功能</uni-view>
						</view>
					</navigator>
					<u-icon @click="tuichu" size="40" name="grid"></u-icon>
				</view>
			</view>
			<view class="nav">
				<a href="#">
					<u-icon size="40" color="#FEBD00" name="file-text"></u-icon>
					<p>订单</p>
				</a>
				<a href="#">
					<u-icon size="40" color="#FEBD00" name="chat-fill"></u-icon>
					<p>消息</p>
				</a>
				<a href="#">
					<u-icon size="40" color="#FEBD00" name="star"></u-icon>
					<p>收藏</p>
				</a>
				<a href="#">
					<u-icon size="40" color="#FEBD00" name="edit-pen"></u-icon>
					<p>学习</p>
				</a>
			</view>
		</view>


		<view class="item">
			<view class="item1">
				<u-icon size="20" name="rmb-circle"></u-icon>
				<p>我的优惠价</p>
			</view>
			<span>></span>
		</view>

		<view class="item">
			<view class="item1">
				<u-icon size="20" name="rmb-circle"></u-icon>
				<p>我的优惠价</p>
			</view>
			<span>></span>
		</view>

		<view class="item">
			<view class="item1">
				<u-icon size="20" name="rmb-circle"></u-icon>
				<p @click="tiao">我的优惠价</p>
			</view>
			<span>></span>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				user: uni.getStorageSync("user")
			}
		},
		methods: {
			tiao() {
				uni.navigateTo({
					url: "/pages/bind-phone/bind-phone"
				})
			},
			//跳转
			islogin() {
				if (this.user) {
					uni.navigateTo({
						url: "/pages/setting/setting"
					})

				} else {
					console.log('登录');
					uni.navigateTo({
						url: "/pages/login/login"
					})
				}
			},
			//退出
			tuichu() {
				uni.navigateTo({
					url: "/pages/setting/setting"
				})
			},

		}
	}
</script>

<style scoped lang="scss">
	.item {
		display: flex;
		justify-content: space-between;
		padding-left: 50rpx;
		padding-right: 50rpx;
		margin-top: 30px;
		border-bottom: 3px solid #F9F9F9;

		span {
			color: rgb(187, 187, 187);
			font-size: 16px;
		}

		.item1 {
			display: flex;
			align-items: center;

			p {
				font-size: 25rpx;
				margin-left: 20rpx;


			}
		}
	}

	.tu {
		width: 750rpx;
		height: 304rpx;
		background-color: #5DCB83;
		border-bottom-right-radius: 20%;
		border-bottom-left-radius: 20%;

		.nav {
			width: 648rpx;
			height: 142px;
			background-color: white;
			margin-left: 52rpx;
			margin-top: 40rpx;
			display: flex;
			justify-content: space-around;
			justify-content: center;
			align-items: center;

			a {
				text-decoration: none;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				width: 25%;
				height: 100%;
				background-color: white;

				p {
					margin-top: 10rpx;
					font-size: 30rpx;
					color: black;

				}
			}

		}

		.header {
			width: 750rpx;
			height: 138rpx;
			background-color: #5DCB83;
			display: flex;
			justify-content: center;
			align-items: center;

			.list {
				width: 700rpx;
				height: 125rpx;
				background-color: #5DCB83;
				display: flex;
				justify-content: space-around;
				align-items: center;

				.zi {
					margin-right: 276rpx;

					.font-md {
						font-size: 38rpx;
						color: white;

					}

					.font-sm {
						font-size: 27rpx;
						color: aliceblue;
						margin-top: 10rpx;

					}
				}

				.yuan {
					width: 100rpx;
					height: 100rpx;
					border-radius: 50%;
					background-color: white;
				}
			}
		}
	}
</style>
